// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbkc -emit-llvm %s -o - \
// RUN:     | FileCheck %s  -check-prefix=RV32ZBKC

// RV32ZBKC-LABEL: @clmul(
// RV32ZBKC-NEXT:  entry:
// RV32ZBKC-NEXT:    [[A_ADDR:%.*]] = alloca i32, align 4
// RV32ZBKC-NEXT:    [[B_ADDR:%.*]] = alloca i32, align 4
// RV32ZBKC-NEXT:    store i32 [[A:%.*]], ptr [[A_ADDR]], align 4
// RV32ZBKC-NEXT:    store i32 [[B:%.*]], ptr [[B_ADDR]], align 4
// RV32ZBKC-NEXT:    [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
// RV32ZBKC-NEXT:    [[TMP1:%.*]] = load i32, ptr [[B_ADDR]], align 4
// RV32ZBKC-NEXT:    [[TMP2:%.*]] = call i32 @llvm.riscv.clmul.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBKC-NEXT:    ret i32 [[TMP2]]
//
long clmul(long a, long b) {
  return __builtin_riscv_clmul(a, b);
}

// RV32ZBKC-LABEL: @clmulh(
// RV32ZBKC-NEXT:  entry:
// RV32ZBKC-NEXT:    [[A_ADDR:%.*]] = alloca i32, align 4
// RV32ZBKC-NEXT:    [[B_ADDR:%.*]] = alloca i32, align 4
// RV32ZBKC-NEXT:    store i32 [[A:%.*]], ptr [[A_ADDR]], align 4
// RV32ZBKC-NEXT:    store i32 [[B:%.*]], ptr [[B_ADDR]], align 4
// RV32ZBKC-NEXT:    [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
// RV32ZBKC-NEXT:    [[TMP1:%.*]] = load i32, ptr [[B_ADDR]], align 4
// RV32ZBKC-NEXT:    [[TMP2:%.*]] = call i32 @llvm.riscv.clmulh.i32(i32 [[TMP0]], i32 [[TMP1]])
// RV32ZBKC-NEXT:    ret i32 [[TMP2]]
//
long clmulh(long a, long b) {
  return __builtin_riscv_clmulh(a, b);
}
